package gtzl.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;

public class BaseDao {
	private static SessionFactory sessionFactory;
	public static Session session;
	public static Transaction tx;

	public static SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public static void setSessionFactory(SessionFactory sessionFactory) {
		BaseDao.sessionFactory = sessionFactory;
	}

	public static Session getSession() {
		session = sessionFactory.openSession();
		return session;
	}

}
